package com.hyz.controller;

import com.hyz.pojo.ResponseResult;
import com.hyz.pojo.assetSecondment.AssetSecondmentRequest;
import com.hyz.pojo.assetSecondment.AssetSecondmentResponse;
import com.hyz.service.ChargeLeaderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/6 18:00
 */
@Api("分管领导")
@RestController
@RequestMapping("/chargeLeader")
public class ChargeLeaderController {
    @Autowired
    private ChargeLeaderService service;

    @ApiOperation("分管领导查询")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/clGetAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> clGetAssetSecondment() {
        return service.clGetAssetSecondment();
    }

    @ApiOperation("分管领导审批")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/clUpdateAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> clUpdateAssetSecondment(@RequestBody AssetSecondmentRequest request) {
        return service.clUpdateAssetSecondment(request);
    }

}
